IF EXISTS (SELECT * FROM sysobjects WHERE type = 'P' AND name = 'spUsers_Update')
	BEGIN
		PRINT 'Dropping Procedure spUsers_Update'
		DROP  Procedure  spUsers_Update
	END

GO

PRINT 'Creating Procedure spUsers_Update'
GO
Create Procedure dbo.spUsers_Update
	( 	  
		@User_ID numeric(9,0), 
		@UserLogon varchar(50), 
		@UserPassword varchar(50) = null, 
		@FirstName varchar(100) = null, 
		@Surname varchar(100) = null, 
		@Extention varchar(50) = null, 
		@Telephone varchar(50) = null, 
		@Cellphone varchar(50), 
		@Email varchar(250) = null, 
		@DivisionName varchar(50) = null, 
		@DepartmentName varchar(50) = null, 
		@Access varchar(5000) = null, 
		@Active bit = null
	)
AS
  /* 
    ------------------------------------------------------------------------------
    - Change History
    - --------------
    - Date          Description
    ------------------------------------------------------------------------------
    - 2007/11/02    Initial version Updated
    ------------------------------------------------------------------------------
  */

	-- Declare the required variables

	-- Update the required new record
	UPDATE Users
	SET
		UserLogon = @UserLogon, 
		UserPassword = @UserPassword, 
		FirstName = @FirstName, 
		Surname = @Surname, 
		Extention = @Extention, 
		Telephone = @Telephone, 
		Cellphone = @Cellphone, 
		Email = @Email, 
		DivisionName = @DivisionName, 
		DepartmentName = @DepartmentName, 
		Access = @Access, 
		Active = @Active		
	WHERE User_ID = @User_ID

	-- Return to calling method
	RETURN
	
GO
